package com.kingdee.eas.minghua.contract.app;

import org.apache.log4j.Logger;

import com.kingdee.bos.BOSException;
import com.kingdee.bos.Context;
import com.kingdee.bos.dao.IObjectValue;
import com.kingdee.bos.dao.ormapping.ObjectUuidPK;
import com.kingdee.eas.common.EASBizException;
import com.kingdee.eas.common.client.SysContext;
import com.kingdee.eas.minghua.contract.QthtDocFactory;
import com.kingdee.eas.minghua.contract.QthtDocInfo;
import com.kingdee.eas.minghua.jczlwh.mj.SfshEnum;
import com.kingdee.eas.util.app.DbUtil;

public class QthtDocControllerBean extends AbstractQthtDocControllerBean
{
    private static Logger logger =
        Logger.getLogger("com.kingdee.eas.minghua.contract.app.QthtDocControllerBean");

	protected void _audit(Context ctx, IObjectValue model) throws BOSException {
		// TODO Auto-generated method stub
		super._audit(ctx, model);
		QthtDocInfo info = (QthtDocInfo)model;
//		String id =info.getId().toString();
//		info.setDjzt(SfshEnum.yes);
//		info.setAuditor(SysContext.getSysContext().getCurrentUserInfo());
//		try {
//			QthtDocFactory.getLocalInstance(ctx).update(new ObjectUuidPK(id), info);
//		} catch (EASBizException e) {
//			e.printStackTrace();
//		}
		 StringBuffer sb = new StringBuffer();
			sb.append(" update T_CON_QthtDoc set CFDjzt= '"+1+"'");
			sb.append(" where fid='"+info.getId().toString()+"'");
			DbUtil.execute(ctx,sb.toString());
	}
	

	protected void _unaudit(Context ctx, IObjectValue model)
			throws BOSException {
		// TODO Auto-generated method stub
		super._unaudit(ctx, model);
		QthtDocInfo info = (QthtDocInfo)model;
//		String id =info.getId().toString();
//		info.setDjzt(SfshEnum.save);
//		info.setAuditor(null);
//		try {
//			QthtDocFactory.getLocalInstance(ctx).update(new ObjectUuidPK(id), info);
//		} catch (EASBizException e) {
//			e.printStackTrace();
//		}
		StringBuffer sb = new StringBuffer();
		sb.append(" update T_CON_QthtDoc set CFDjzt= '"+3+"'");
		sb.append(" where fid='"+info.getId().toString()+"'");
		DbUtil.execute(ctx,sb.toString());
	}
    
}